#ifndef __SHT31_H__
#define __SHT31_H__

#ifdef __cplusplus
 extern "C" {
#endif
#include "main.h"

#define SHT31_RST_PIN							GPIO_PIN_13
#define SHT31_RST_GPIO_PORT					    GPIOC
#define SHT31_RST_CLK_ENABLE()      			__HAL_RCC_GPIOC_CLK_ENABLE()
#define SHT31_RST_CLK_DISABLE()     			__HAL_RCC_GPIOC_CLK_DISABLE()

#define SHT31_DEFAULT_ADDR      0x44    /* ADDR = 0 */
//#define SHT31_ADDR      0x45  /* ADDR = 1 */

#define SHT31_CMD_RST                   0x30A2
#define SHT31_CMD_HIGH_STRETCH          0x2C06
#define SHT31_CMD_MEDIUM_STRETCH        0x2C0D
#define SHT31_CMD_LOW_STRETCH           0x2C10
#define SHT31_CMD_PERIOD_MEAS_ART       0x2B32
#define SHT31_CMD_BREAK                 0x3093
#define SHT31_CMD_FETCH                 0xE000

void SHT31_Init(void);
void SHT31_SoftReset(void);
int8_t SHT31_GetSingleShotData(uint16_t *humidity, int16_t *temperature);
#ifdef __cplusplus
    }
#endif
#endif  /* __SHT31_H__ */
/************************************ END OF FILE ************************************/
